package com.dldata.devtools30.cfg;

import com.dldata.devtools30.common.EnumOrganization;
import org.springframework.boot.web.context.WebServerApplicationContext;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ApplicationInit implements ApplicationListener<WebServerInitializedEvent> {
    
    @Override
    public void onApplicationEvent(WebServerInitializedEvent event) {
        WebServerApplicationContext applicationContext = event.getApplicationContext();
        ModelTableViewCreateTask tableViewCreateTask = applicationContext.getBean(ModelTableViewCreateTask.class);
        tableViewCreateTask.createModelTableView();
    
//        EnumOrganization.enumOrganizationList.add(new EnumOrganization("测试代码","测试名称"));
    }
    
}
